package com.design.cjm.behavioral.interpreter.example;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Jie Ming Chen
 * @Date: 2018/9/26
 * @Version 1.0
 */
public class TestApp {

    public static void main(String[] args) {
        Context context = new Context();

        List<AbstractExpression> list = new ArrayList<>();
        list.add(new TerminalExpression());
        list.add(new NonterminalExpression());
        list.add(new TerminalExpression());
        list.add(new TerminalExpression());

        for (AbstractExpression exp: list) {
            exp.interpret(context);
        }
    }
}
